<html>
<script>
    function DataHora(){ 
        var data = new Date(); 
        tempo.innerHTML = data; 
		campo1.value = data.getMilliseconds();
        setTimeout("DataHora()",1000);
    } 

</script>
<body onLoad="DataHora()">
<h1> BEM-VINDO! Hora automatica </h1>

<input type="text" id="campo1" />
<span id="tempo"></span>

</body>

</html>